<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Knowbase_project_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-knowbase_project_id" data-field="title" data-rule="required" data-source="knowbase/project/index" class="form-control selectpage" name="row[knowbase_project_id]" type="text" value="{$row.knowbase_project_id|htmlentities}" disabled>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]" >
                {foreach name="typeList" item="vo"}
                    <option value="{$key|htmlentities}" {in name="key" value="$row.type"}selected{/in}>{$vo|htmlentities}</option>
                {/foreach}
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
        <div class="col-xs-12 col-sm-8">
<!--            <input id="c-pid" data-rule="required" min="0" class="form-control" name="row[pid]" type="number" value="{$row.pid|htmlentities}">-->
            <input id="c-pid" data-field="title" data-rule="required" data-params='{"knowbase_project_id":"{$row.knowbase_project_id|htmlentities}","id":"{$row.id|htmlentities}","from":"select"}' data-source="knowbase/project_page/index" class="form-control selectpage" name="row[pid]" type="text" value="{$row.pid|htmlentities}">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status_switch')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <input  id="c-status_switch" name="row[status_switch]" type="hidden" value="{$row.status_switch|htmlentities}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status_switch" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success {eq name="$row.status_switch" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
            </a>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group identify" {if $row.type=='url'} style="display: none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Identify')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-identify" class="form-control" name="row[identify]" type="text" value="{$row.identify|htmlentities}">
            <span class="help-block">{:__('tips_project_identify')}</span>
        </div>
    </div>
    <div class="form-group page_content" {if $row.type=='url'} style="display: none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="c-content-vditor" class="vditor_editor" >
              
            </div>
            <textarea id="c-content" class="form-control vditor hide" rows="5" name="row[content]" cols="50">{if $row.type=='url'}{else}{$row.content|htmlentities}{/if}</textarea>
        </div>
    </div>

    <div class="form-group url" {if $row.type!='url'} style="display: none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('跳转链接')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-url" data-rule="url" class="form-control" name="row[url]" type="text" {if $row.type=='url'}  value="{$row.content|htmlentities}" {else}  value="" {/if}>
        </div>
    </div>
    

    

    
    <div class="form-group password" {if $row['access_type']!=1} style="display:none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
            <input id="c-password" class="form-control" name="row[password]" type="text" value="{$row.password|htmlentities}">
                <span class="input-group-btn">
                    <a class="btn btn-default btn-random" >{:__('create_random')}</a>
                </span>
            </div>
        </div>
    </div>
    
    <div class="form-group user_group_ids" {if $row['access_type']!=2} style="display:none;" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('User_group_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_group_ids"  data-source="user/group/index" data-multiple="true" class="form-control selectpage" name="row[user_group_ids]" type="text" value="{$row.user_group_ids|htmlentities}">
        </div>
    </div>

    <div class="form-group sync_switch" {if $row['type']=='file'} style="display:none;"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('sync_switch')}:</label>
        <div class="col-xs-12 col-sm-8">

            <input  id="c-sync_switch" name="row[sync_switch]" type="hidden" value="0">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-sync_switch" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success  fa-flip-horizontal text-gray fa-2x"></i>
            </a>
            <span class="help-block">{:__('tips_page_sync_switch')}</span>
        </div>
    </div>
    

    
    <div class="form-group hide">
        <label class="control-label col-xs-12 col-sm-2">{:__('Py')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-py" class="form-control" name="row[py]" type="text" value="{$row.py|htmlentities}">
        </div>
    </div>
    
    <div class="form-group hide">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pinyin')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-pinyin" class="form-control" name="row[pinyin]" type="text" value="{$row.pinyin|htmlentities}">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-lg-4 col-md-4 col-xs-4 col-sm-4">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="button" class="btn btn-warning" id="save" data-toggle="tooltip" title="{:__('tips_save_without_close')}" data-placement="right">{:__('btn_save_without_close')}</button>
            <button type="submit" class="btn btn-success {:$auth->check('knowbase/project_page_template/templates')?'':'hide'}"  id="template" {if $row['type']=='url'} style="display:none;" {/if}>{:__('btn_look_template')}</button>
            <button type="submit" class="btn btn-info hide {:$auth->check('knowbase/project_page_history/page_history')?'':'hide'}" data-id="{$row.id|htmlentities}" id="history">{:__('btn_look_history')}</button>
        </div>
         <div class="col-lg-3 col-md-3 col-xs-3 col-sm-3">
             <div class="alert alert-warning hide" style="padding-top: 0px;padding-bottom: 0px;margin-bottom: 0;width: 330px;">
                 <i class="fa fa-info-circle"></i> &nbsp;<span class="text">草稿已于 <span class="time">16:36:11</span> 自动保存</span>&nbsp;|<button type="button" class="btn btn-link remove" style="color: #fff;outline: 0;-webkit-box-shadow:none;box-shadow:none;"><i class="fa fa-remove"></i> 清除草稿</button>
             </div>
             <div class="alert alert-danger hide" style="padding-top: 0px;padding-bottom: 0px;margin-bottom: 0;width: 360px;">
                 <i class="fa fa-exclamation-triangle"></i> &nbsp;<button type="button" class="btn btn-link recover" style="color: #fff;outline: 0;padding-left: 0;padding-right: 0;">发现未保存的草稿数据，点击还原</button> |<button type="button" class="btn btn-link remove" style="color: #fff;outline: 0;outline: 0;-webkit-box-shadow:none;box-shadow:none;"><i class="fa fa-remove"></i> 清除草稿</button>
             </div>
         </div>
    </div>
    
</form>

{include file='knowbase/project_page/show_history'/}

